UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ChiGVhTpGTx2uRHbEwBIemUk2wnvFw8qUYaBts7EO0c=' 
WHERE 
  key_id = 'dc809aa8ca1b3b563e6ee14c8e0b22278833cdcc142f31d686041e048f0e3e74' 
  AND (
    token = 'ChiGVhTpGTx2uRHbEwBIemUk2wnvFw8qUYaBts7EO0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034