UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '81v2YJ+qfbMQT8mXOGj1vCbOVreaCAubDYhxBC1akUM='
WHERE
key_id = '6111d856830cbbd576700cd30a6447019518aad07ef7fa2d3875eaa0645e20d4'
AND (
token = '81v2YJ+qfbMQT8mXOGj1vCbOVreaCAubDYhxBC1akUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)