UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 300, 
  token = 'ja5XyF1EGJV2xlqmKt1pJhsi+YclkM7fcCkgvxTKs9A=' 
WHERE 
  key_id = 'ab3d590eb542bff1b74216a066e167a0888f96bc93fccba0f730463a346fcd54' 
  AND (
    token = 'ja5XyF1EGJV2xlqmKt1pJhsi+YclkM7fcCkgvxTKs9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020