UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6S9DhShwO5dAoBjXJXx46Bjg8wh3m+l6e5cHDedsVvc='
WHERE
key_id = '84bcb1724f48c16f7842def902842635d4eaa4d2b04d8eff1d276cd5af62f052'
AND (
token = '6S9DhShwO5dAoBjXJXx46Bjg8wh3m+l6e5cHDedsVvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)