UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yHxsRjXvmZsWdG6a7noc+rD94zY7aJ2L2w/Pl0OEt64=' 
WHERE 
  key_id = 'd4a7cf860e058d03f43d41cc1d6dbfad507349d383db1117880fdac977c3b488' 
  AND (
    token = 'yHxsRjXvmZsWdG6a7noc+rD94zY7aJ2L2w/Pl0OEt64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033