UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dQqWbJxwDly8oB1DGUqeXw04kLg/lYMHHip8mbd6wV8='
WHERE
key_id = '95fc761ef7ce8705bd7c11079f8351cdf057a51f96ea0ccb6320fb20d6721e1c'
AND (
token = 'dQqWbJxwDly8oB1DGUqeXw04kLg/lYMHHip8mbd6wV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)