UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4ckXVGdHekpFJ6IwgWLGZM06pmhxVmq8Yr66UN2W+w='
WHERE
key_id = '92a3437667a457522a6a4aca59144fbe5dfd72d62735cb1ff488c105d8778478'
AND (
token = '+4ckXVGdHekpFJ6IwgWLGZM06pmhxVmq8Yr66UN2W+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)