UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R8ZRoiBKBv9Ait4Sg+5ZERxZtZrwhNC8YBg8J0LFnkM='
WHERE
key_id = '1881fa23412610d9c2280b94cbf148033b79fd7b96b508d7775a84548fe81f76'
AND (
token = 'R8ZRoiBKBv9Ait4Sg+5ZERxZtZrwhNC8YBg8J0LFnkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)