UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vcuozc4lIFX9NxEK/1gM6Df6za1jgg/Ll4LtZ3L+sx0=' 
WHERE 
  key_id = 'c8985251fec83d19a4b2bf090438ef7f4671c45253a88692b9ff1f0ca4a77df2' 
  AND (
    token = 'vcuozc4lIFX9NxEK/1gM6Df6za1jgg/Ll4LtZ3L+sx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00103