UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r80vpJWTRscoWnfGdmPq5KuUsEVxQkalZoeu9d2PDq4='
WHERE
key_id = '15bbdc023a2669d1b71875ef12bc20a799bf45d74522e0796ec1a98757bbf132'
AND (
token = 'r80vpJWTRscoWnfGdmPq5KuUsEVxQkalZoeu9d2PDq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)