UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxSCvPIkTcjvp/noq2qOz1WYqg1xp40yFR+QbIsKVNw=' 
WHERE 
  key_id = 'ac376b043fb3f9dea9c35a9853100151d39fe90a0dafed0f5d61eb35996922b3' 
  AND (
    token = 'uxSCvPIkTcjvp/noq2qOz1WYqg1xp40yFR+QbIsKVNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050