UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zVf47QcCkehz9JmIo+DtQW8YLxkfHb1S0HQ8/LpHN5w='
WHERE
key_id = '216488f137dd968544927ff31fac87517fa1acd182f0d99a84404a143848324f'
AND (
token = 'zVf47QcCkehz9JmIo+DtQW8YLxkfHb1S0HQ8/LpHN5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)