UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tjQ5zr5EpTDqDoNFtcwTbXTmHycTTbXwodDtuh619RA=' 
WHERE 
  key_id = '6494770668b11b4329cf9ce21630827bd94edb108d156e661ebcfb2ffb2513cc' 
  AND (
    token = 'tjQ5zr5EpTDqDoNFtcwTbXTmHycTTbXwodDtuh619RA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029