UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7J4Hw4SnSVqrr9zvtz+mntCGHFJxanYq19oJ1q05TAg=' 
WHERE 
  key_id = '8b0d9c96c761f9a28a6d855b14678680667b2141db18a7cbf7d5df0a6cdfdb51' 
  AND (
    token = '7J4Hw4SnSVqrr9zvtz+mntCGHFJxanYq19oJ1q05TAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044