UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qZo9iFm2JRcg+Di761BX152NGWpEeZpoXlxvwMvZ4OY=' 
WHERE 
  key_id = 'd95091e95bab727ecb58118008b7f48c2ea23b643dbbc5ec78470cd4debbe41d' 
  AND (
    token = 'qZo9iFm2JRcg+Di761BX152NGWpEeZpoXlxvwMvZ4OY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026