UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zi8ohd+pIETIQI0/qog9pKbTmxJi8AvLJ95vXdjR7/I=' 
WHERE 
  key_id = '277b3a406d405382fbf202d1e514709781ff9548a05470d3c5e50bb4b3302f5b' 
  AND (
    token = 'Zi8ohd+pIETIQI0/qog9pKbTmxJi8AvLJ95vXdjR7/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038