UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B8jgy/8cMo/Tj22SkgAO6wCJYJsRTLDHdt/z3j2Hm0k=' 
WHERE 
  key_id = '1fc671a4a644715dbf4b62de2024389d812420425e213ecb112d1bf9ee9b499e' 
  AND (
    token = 'B8jgy/8cMo/Tj22SkgAO6wCJYJsRTLDHdt/z3j2Hm0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039