UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YYWeHPOuUjUWfz6l2fI4LQ3Hv4bb4cuetGZuqBd5g9I=' 
WHERE 
  key_id = 'ddad22c893a64fbfbe76bc409212ed35f131fbb20b571162bd7076bcd583aefd' 
  AND (
    token = 'YYWeHPOuUjUWfz6l2fI4LQ3Hv4bb4cuetGZuqBd5g9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027