UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F1At4wRI3/UjfWhhX6dG9rf7Is3i3EmiRdIUAtSQVWo=' 
WHERE 
  key_id = 'df3cf5f3c66128cb65228554eb47b77053aed3efa4b2aff548e94e663a1dd3d1' 
  AND (
    token = 'F1At4wRI3/UjfWhhX6dG9rf7Is3i3EmiRdIUAtSQVWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034