UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '95TZ00Y96HZfIcmi1IZWXswySkOJ2008fwzjyAUwBio=' 
WHERE 
  key_id = '7ce471b9382992012a66ded1a4fb974fe5c095fef3399dcdc1cd94d872d89e3f' 
  AND (
    token = '95TZ00Y96HZfIcmi1IZWXswySkOJ2008fwzjyAUwBio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023