UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DCyza99rjo7I+IJJCYzBdi5o1Fknp1mupLRtoBvzuBg=' 
WHERE 
  key_id = 'a4c62d9467772c2fbc32388039b545febbdb42b64b89366149d561dc1e373a0d' 
  AND (
    token = 'DCyza99rjo7I+IJJCYzBdi5o1Fknp1mupLRtoBvzuBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038