UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZBo4zRRwlp88kH5shHKZNpWqj72IMsgSgWto2cC2lo8='
WHERE
key_id = '3cbee7e213dffb832a11f2c88ee34475998cecdda6b9843b56024dcee836edf0'
AND (
token = 'ZBo4zRRwlp88kH5shHKZNpWqj72IMsgSgWto2cC2lo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)