UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wQ5Yhtxec6Yf0WU75FBZcLIsnihH/6W8lYYroRhOjY='
WHERE
key_id = '4158be04c7da3c74636686b9dbcc3b98651f634e870e6d74ceca947c8b8b54e2'
AND (
token = '7wQ5Yhtxec6Yf0WU75FBZcLIsnihH/6W8lYYroRhOjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)