UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QEUx+Rvly2GjNpeBSGu+16JqNIZLOdqkepcwrOZqCII=' 
WHERE 
  key_id = 'cd5762a2a0c2b829e3acc91901ea6e112ab7a2d431bb6978ff7e92b506dd006a' 
  AND (
    token = 'QEUx+Rvly2GjNpeBSGu+16JqNIZLOdqkepcwrOZqCII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031