UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i8IK/hvYaC2g9izAXu8NmHzPCO+kQigshnOsknGb8jg='
WHERE
key_id = '801da1cc35079cbab47c35e27918b85e3a547e5c72b7b8b46edbd7bcf9202f11'
AND (
token = 'i8IK/hvYaC2g9izAXu8NmHzPCO+kQigshnOsknGb8jg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)