UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dndhk2YvSTqMNxiIQHHOVpxSoGLgfCl+YbXp8V8np4o='
WHERE
key_id = 'b97e59e590fcbd5d478d8116cc858c2eee0b0bea4160e7ac5ad0eb796ed03286'
AND (
token = 'Dndhk2YvSTqMNxiIQHHOVpxSoGLgfCl+YbXp8V8np4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)