UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lMqOiT+qKE4Hud3X21OHqWiw2fqAsfn0MhZMQEo/nVI=' 
WHERE 
  key_id = '2c06bb1fab12294d73ea16c52cf4d91b9cf790a6d69285ce934e4d013cca04ef' 
  AND (
    token = 'lMqOiT+qKE4Hud3X21OHqWiw2fqAsfn0MhZMQEo/nVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029