UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RZWHI0vvgNxrxc9kDO1CEv9/5u/FmO0dbuXaOERucE0='
WHERE
key_id = '9d36429c24e43ec19851da9fab4be446ed8f02b1b95c99aa7d5a1e86194a3eba'
AND (
token = 'RZWHI0vvgNxrxc9kDO1CEv9/5u/FmO0dbuXaOERucE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)