UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WmenHijUGU5EcOqmPHq/wbT06esNCeGXAzNqBu0FqTg=' 
WHERE 
  key_id = '999e94e9c675ad374bd6c92b71401a2929321d391dd66f4c0ead4da5c86e4ee3' 
  AND (
    token = 'WmenHijUGU5EcOqmPHq/wbT06esNCeGXAzNqBu0FqTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044