UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z2kf2BfPQxsMxId7wBlylaIYELUdM2IYpIlXCFju/eM=' 
WHERE 
  key_id = '07c9a2cb1db9e97a6d8ef556d4615d9da5e45b463645938afd93260a19e0f92e' 
  AND (
    token = 'Z2kf2BfPQxsMxId7wBlylaIYELUdM2IYpIlXCFju/eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032