UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p++ssAbSYNO3H0dGGuSmj9+9s03HenxjcH8JR+WQqJw='
WHERE
key_id = '354dd29c84708d4ddb69e19cadc2d76dd81d5d0a3f0def8b5729f8be75eee812'
AND (
token = 'p++ssAbSYNO3H0dGGuSmj9+9s03HenxjcH8JR+WQqJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)