UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MP9B6sK6ttvfxJe+WqPvnQ9ZIDdl45bkmFwUgVJBwl4='
WHERE
key_id = 'b04efe8aa45e9bd3cb5d7de019d1999269f03f6d88eba00b391a1dc4c4f9442a'
AND (
token = 'MP9B6sK6ttvfxJe+WqPvnQ9ZIDdl45bkmFwUgVJBwl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)