UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qlR1F4Y2ssN6pEFf2mFszNszIasiSEkUBka/7bDvXtM=' 
WHERE 
  key_id = '9ae387bf19efdddfacd945c184073a80cdff1a84bc3cb47f9c2c03f9e53f113a' 
  AND (
    token = 'qlR1F4Y2ssN6pEFf2mFszNszIasiSEkUBka/7bDvXtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018