UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7IwzxeBZK4TCM5PP7XGbPt4ot4KZ1qxNk9Lnve+/0co=' 
WHERE 
  key_id = '84cdf98c486d2f23e8b630695869377e5ed7f294aac2be22d70338cd11a4db94' 
  AND (
    token = '7IwzxeBZK4TCM5PP7XGbPt4ot4KZ1qxNk9Lnve+/0co=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033