UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'enaZ+Oz0H0+JFyJsPOaQi18E7glw/0F0UrVP0gF267c=' 
WHERE 
  key_id = '2203e414ec23111aeabe9a021e7b251ec56f5b36f50e81d8fdf64e60d7df769c' 
  AND (
    token = 'enaZ+Oz0H0+JFyJsPOaQi18E7glw/0F0UrVP0gF267c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038