UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dmz02NC/OQxUNUQrh4IF4rWXj3d42Lvzynq14HjOGUI=' 
WHERE 
  key_id = '5cc18e53b528a50ba14fb1215c1e34f2e0a0fe1114e0daa100684b2c41e90c7a' 
  AND (
    token = 'dmz02NC/OQxUNUQrh4IF4rWXj3d42Lvzynq14HjOGUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021