UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3Px04YE1bX+8QVmK4zgySGxA3rMiNuVzjrOc4sWDDc='
WHERE
key_id = '440f41165aa8ac7edde448f97e47734a0bcfcca98159a23b4b00dd33b6882ea2'
AND (
token = 'o3Px04YE1bX+8QVmK4zgySGxA3rMiNuVzjrOc4sWDDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)