UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l4VcC+p2FyK6gIeDcF/4xz4HYJExSJGq3riu6qNSfMM='
WHERE
key_id = '3e18d0f37689c1afc44f6ff982e8660be0ef38a11fab41af96f24494053dadf3'
AND (
token = 'l4VcC+p2FyK6gIeDcF/4xz4HYJExSJGq3riu6qNSfMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)