UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DlN/BWmhK47s1bFh68UsVVOUGp5w+wKkavj8UrpQLvA='
WHERE
key_id = '614cb2ba029ecbaad3e44cbeccbf16fe8922094324a50d3711bd5ca5049cfab0'
AND (
token = 'DlN/BWmhK47s1bFh68UsVVOUGp5w+wKkavj8UrpQLvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)