UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X7/rJt2xUEisEgCTrfKMIGtp1k551MDm7DxXolqetso='
WHERE
key_id = '949a65f58706821299e716f696f13ae10039b9389fe48231da4066962a3cf99b'
AND (
token = 'X7/rJt2xUEisEgCTrfKMIGtp1k551MDm7DxXolqetso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)