UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IVt63Qf42e2cZpObzKPqYztZYxrVHJ8keKO8zXaLS3U='
WHERE
key_id = '1cbbcd6ae7a50597de5d0efdaeb6206f8b0f98b9634527597806d4d3030cfd9b'
AND (
token = 'IVt63Qf42e2cZpObzKPqYztZYxrVHJ8keKO8zXaLS3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)