UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rh5EDto+miJx/298PqyE5r2JyEU7Ax4qunJ0+zqKpSA=' 
WHERE 
  key_id = '2414aba5b209e49a3a1d297fd71e3ab69331b56cda11cc9f44ce851820b7664c' 
  AND (
    token = 'Rh5EDto+miJx/298PqyE5r2JyEU7Ax4qunJ0+zqKpSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072