UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4rKZ/yB84COxFh0nzy2qUJfQjYq/7Oz3j3rvDWAMyvY='
WHERE
key_id = '6c8bf6b0733c0554297f88b696952e03e0fa6da6e15af7da6632d0a29b71e39e'
AND (
token = '4rKZ/yB84COxFh0nzy2qUJfQjYq/7Oz3j3rvDWAMyvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)