UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3TQfEQhSQPnmo+JNpvUTscuJmZmpGchm3eOIINwzbrI=' 
WHERE 
  key_id = 'b09a99d55843e8236519f02eda3820dc843bd1633ff3a8fd1bb3bf55dd9e437d' 
  AND (
    token = '3TQfEQhSQPnmo+JNpvUTscuJmZmpGchm3eOIINwzbrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025