UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XXl9VBOFNpm4zdYT2HIr1WDYXJ3Y+pI5Qan0OG0g2Is=' 
WHERE 
  key_id = '8f36494f9c2acf1849af86040e6f21174ab7d419c2b6e1836293ad8d32a3b942' 
  AND (
    token = 'XXl9VBOFNpm4zdYT2HIr1WDYXJ3Y+pI5Qan0OG0g2Is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026