UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1GlJksjcQ+Btrh9yWkk2N3jlY0Q7m6IwUyP7/n8W/60=' 
WHERE 
  key_id = '38bba11b1a85973ce0f8aa06de344ad57275d5bb76eeebf74445edbde243ec75' 
  AND (
    token = '1GlJksjcQ+Btrh9yWkk2N3jlY0Q7m6IwUyP7/n8W/60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032